{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Factorial of 5 is:  6\n"
     ]
    }
   ],
   "source": [
    "def fact(n):\n",
    "    return 1 if n <= 1 else n*fact(n-1)\n",
    "\n",
    "print(\"Factorial of 5 is: \",fact(3))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "matriz 1:\n",
      "[[5, 2], [3, 4]]\n",
      "matriz 2:\n",
      "[[5, 2], [3, 4]]\n",
      "matriz 3:\n",
      "[[1, 2], [3, 4]]\n",
      "matriz 4:\n",
      "[[5, 2], [3, 4]]\n"
     ]
    }
   ],
   "source": [
    "from copy import deepcopy\n",
    "from copy import copy\n",
    "\n",
    "matriz1 = [[1,2],[3,4]]\n",
    "matriz2 = matriz1\n",
    "matriz3 = deepcopy(matriz1)\n",
    "matriz4 = copy(matriz1)\n",
    "matriz1[0][0]=5\n",
    "\n",
    "print(\"matriz 1:\")\n",
    "print(matriz1)\n",
    "print(\"matriz 2:\")\n",
    "print(matriz2)\n",
    "print(\"matriz 3:\")\n",
    "print(matriz3)\n",
    "print(\"matriz 4:\")\n",
    "print(matriz4)\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.10.4 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
